const Check = {
	// 验证发票代码
	checkInvoiceNo(n) {
        var reg = /^\d{10}|\d{12}$/
        let f = ''
		reg.test(n) ? (f = true) : (f = false)
		return f
	},
	// 验证发票号码
	checkInvoicNumber(n) {
		let reg = /^\d{8}$/
		let f = ''
		reg.test(n) ? (f = true) : (f = false)
		return f
	},
	// 发票金额正则
	checkMoney(m) {
		var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
		let f = ''
		reg.test(m) ? (f = true) : (f = false)
		return f
	},
	// 手机号正则
	checkPhone(p) {
		var reg = /^1(3|4|5|7|8)\d{9}$/
		let f = ''
		reg.test(p) ? (f = true) : (f = false)
		return f
	},
	// 短信验证码正则
	checkSMS(s) {
		let reg = /^\d{4}$/
		let f = ''
		reg.test(s) ? (f = true) : (f = false)
		return f
	},
//	验证银行卡
	checkBankNumber(s){
		let reg = /^([1-9]{1})(\d{14}|\d{15}|\d{16}|\d{17}|\d{18}|\d{19}|\d{20})$/
		let f = ''
        reg.test(s) ? (f = true) : (f = false)
        return f
	}
}

export { Check }
